//package cn.com.connected.controllerthrid;
//
//import cn.com.connected.base.exception.ErrorLogRobot;
//import cn.com.connected.service.WeChatMessageService;
//import cn.com.connected.vo.wechat.WeChatMessageValid;
//import com.alibaba.fastjson.JSONObject;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestMethod;
//import org.springframework.web.bind.annotation.RestController;
//
//import javax.annotation.Resource;
//import java.util.concurrent.CompletableFuture;
//
//
//@RestController
//@Api(value = "微信小程序推送消息token验证接口")
//@Slf4j
//public class WechatController {
//
//    @Resource
//    private WeChatMessageService weChatMessageService;
//
//
////    @ApiOperation(value="描述:验证小程序推送token 微信公众平台调用验证服务器的 ok")
////    @RequestMapping(value="/wechat/message/valid-token",method= RequestMethod.GET)
////    public String validWeChatMessagePushToken(WeChatMessageValid message) {
////        String str = weChatMessageService.checkSignature(message);
////        log.info("token valid result : {}",str);
////        return str;
////    }
//
//    @ApiOperation(value="描述: 微信推送消息 ok")
//    @RequestMapping(value="/wechat/message/valid-token",method= RequestMethod.POST)
//    public String validWeChatMessagePushToken(WeChatMessageValid message,@RequestBody JSONObject object) {
//        log.info("微信推送 message body {} ",JSONObject.toJSONString(message));
//        boolean checkResult = weChatMessageService.checkSignature(message);
//        log.info("微信推送 token valid result : {}",checkResult);
//        log.info("微信推送 object {}",object!=null?object.toJSONString():"空的响应体");
//        log.info("微信推送 开始执行回调业务接口");
//        if (checkResult){
////            wallService.handerData(object);
//        }
//        CompletableFuture.runAsync(()->{ ErrorLogRobot.sendError2DingDing(object.toJSONString());});
//
//        return checkResult?message.getEchostr():"";
//    }
//
//    /**测试服务器给小程序用户推送模板消息*/
////    @RequestMapping(value="/wechat/message/push",method= RequestMethod.GET)
////    public void push() {
////        Map json=new HashMap();
////        json.put("phone_number2",new HashMap(){{put("value","13716113967");}});
////        json.put("thing4",new HashMap(){{put("value","测试消息");}});
////        CompletableFuture.runAsync(()-> {
////            weChatMessageService.pushMessage("obIrj5LFABdSrpd0Kgjs3WNQE2XE", messageTempGet, json);
////        });
////    }
//
//
//}
